package Packet;

import java.io.*;
import java.net.*;
import java.util.*;

public class Packet implements Serializable
{
	public Packet(PacketType type, int sourceId, int destinationId, Serializable content)
	{
		this.packetType = type;
		this.sourceId = sourceId;
		this.destinationId = destinationId;
		this.createDate = new Date();
		this.content = content;
	}
    public Packet(PacketType type, Serializable content)
    {
        this.packetType = type;
        this.createDate = new Date();
        this.content = content;
    }
    public Packet(PacketType type, Date createDate, String content)
    {
    	this.packetType = type;
    	this.createDate = createDate;
    	this.content = content;
    }
    public Packet()
    {
    	
    }
    public Date getCreateDate()
    {
    	return createDate;
    }
    public PacketType getPacketType()
    {
    	return packetType;
    }
    public Serializable getContent()
    {
    	return content;
    }
    
    
    public void setSourceId(int sourceId)
    {
    	this.sourceId = sourceId;
    }
    public void setDestionationId(int destionationId)
    {
    	this.destinationId = destionationId;
    }
    public void setPacketType(PacketType type)
    {
    	this.packetType = type;
    }
    public void setCreateDate(Date createDate)
    {
    	this.createDate = createDate;
    }
    public void setContent(Serializable content)
    {
    	this.content = content;
    }
    public void setPacketNum(int packetNum)
    {
    	this.packetNum = packetNum;
    }
    
    public String toString()
    {
    	String str = new String("sourceId : " + sourceId + " destinationID : " + destinationId + " packetType : " +
    			                 packetType + " createDate : " + createDate + " content : " + content + 
    			                 " packetNum : " + packetNum);
    	return str;
    }
    private int sourceId;
    private int destinationId;
    private PacketType packetType;
    private Date createDate;
    private Serializable content;
    private static int packetCounter = 0;
    private int packetNum;
}

